#!/usr/bin/perl
#Demo \Q usage in perl regular expression.
#\Q		quote (disable) pattern metacharacters till \E

my $str = "abcdef";
my $a = ".*";
my $pattern1 = "/\Q$a\E/";
my $pattern2 = "/$a/";

#/\Q$a\E/ = /\.\*/
if ( $str =~ /\Q$a\E/ ) 
{
	print "match\n";
}
else
{
	print "un match\n";
} 

#/$a/ = /.*/
if ( $str =~ /$a/ )
{
	print "match\n";
}
else
{
	print "un match\n";
} 